@extends("backend.layout.main")

@section("before.css")
    <link type="text/css" href="/backend/css/common.css" rel="Stylesheet">
    <link type="text/css" href="/backend/css/header.css" rel="Stylesheet">
    <link type="text/css" href="/backend/css/style.css" rel="Stylesheet">
    <link type="text/css" href="/backend/css/style2.css" rel="Stylesheet">
    <link type="text/css" href="/backend/css/project.css" rel="Stylesheet">
    @endsection


    @section("right_content")

            <!--middle-->
<div class="mainWrapBox">
    <div class="mainBox">

                <h1><a href="/backend/items">项目</a> / {{ $item_name }}
<span class="projects-nav">

    <a class="current-nav" href="http://www.xcube.com.cn/project/task/122/498">任务</a>

    <a href="http://www.xcube.com.cn/project/info.htm?projectId=498">基本信息</a>
</span>    </h1>
                <div class="html" style="height: 100%">
                    <div class="listWrapbox mt10">

                        <h2>任务初始设置</h2>

                        <div class="menu-list mt20">
                            <span class="menu-template">第1步&nbsp;&nbsp;选择项目流程</span>
                            <span class="ml10 menu-template current-menu-template" > 第2步&nbsp;&nbsp;选择设计师</span>
                        </div>
                        <div id="step-2">
                            <div class="menu-tip mt10">
                                Tips：设置设计师
                            </div>
                            <div style="overflow:auto">
                                <div id="task-list-right">
                                    <div class="proect-list-wrap-box mt10" >

                                        <div class="project-task-list">
                                            <h2>任务 </h2>

                                        </div>
                                                <div class="task-list">
                                                <form id="createSubTaskForm" action="/backend/items/task_save" method="post">
                                                    {{ csrf_field() }}
                                                    <table width="100%" style="line-height: 45px">
                                                        <thead >
                                                        <tr>
                                                            <th><div style="border:none;min-width:150px;width:100%" id="createTask">任务名称</div></th>

                                                            <th width="150px">
                                                                <div data-toggle="drop-select" class="drop-select" ><span class="selected-text">任务人</span></div>
                                                            </th>
                                                            <th width="140px"><span>审核人</span></th>
                                                            <th width="180px"> <span>截止日期</span></th>
                                                            <th width="25px"></th>
                                                        </tr>
                                                        </thead>
                                                        <tbody id="task_list">
                                                        @foreach($taskInfo as $k=>$v)
                                                        <tr class="parent-task" data-stage="27" data-id="2622" data-pid="0" data-major="32" data-sub="-1" data-parent="1" style="background-color: rgb(255, 255, 255);">

                                                            <td>

                                                                <div class="ml40 content-2line" style="display: block;margin-top: 5px;">
                                                                    <input type="hidden" name="task_id[]" value="{{ $v['id'] }}">
                                                                    <input type="hidden" name="task_name[]" value="{{ $v['name']  }}">
                                                                    <input type="hidden" name="task_level[]" value="{{ $v['level']  }}">
                                                                    <input type="hidden" name="stage_id[]" value="{{ $v['stage_id']  }}">
                                                                    <input type="hidden" name="type_id[]" value="{{ $v['type_id']  }}">
                                                                    <input type="hidden" name="role_id[]" value="{{ $v['role_id']  }}">
																	<input type="hidden" name="money[]" value="{{ $v['money']  }}">

																	<input type="hidden" name="audit_rank[]" value="{{ $v['audit_rank']  }}">

                                                                    <p>{{ $v['name']  }}</p>
                                                                </div>
                                                            </td>
                                                            <td>
                                                                <div class="drop-select-container clearfix">
                                                                    <div data-toggle="drop-select" class="drop-select" >
                                                                        <select name="member_id_task[]">
                                                                            <option value="0" selected ="selected">请选择</option>
                                                                            @foreach($v['member_id_task'] as $key=>$val)
                                                                                <option value="{{ $val['uid'] }}" >{{ $val['name'] }}</option>
                                                                            @endforeach
                                                                        </select>
                                                                        </div>
                                                                    </div>
                                                            </td>
                                                            <td>
                                                                <div class="drop-select-container clearfix">
                                                                    <div data-toggle="drop-select" class="drop-select" >
                                                                        <select name="member_id_check[]">
                                                                            <option value="0" selected ="selected">请选择</option>
                                                                            @foreach($v['member_id_check'] as $key=>$val)
                                                                                <option value="{{ $val['uid'] }}" >{{ $val['name'] }}</option>
                                                                            @endforeach
                                                                        </select>
                                                                    </div>
                                                                </div>
                                                            </td>

                                                            <td><input type="text" name="task_deadline[]" placeholder="以小时计算"></td>
                                                            <td></td>
                                                        </tr>
                                                        @endforeach
                                                        </tbody>
                                                        <tfoot>
                                                        <tr>
                                                            <td class="text-center task-page" colspan="2">
                                                            </td>
                                                        </tr>
                                                        </tfoot>
                                                    </table>



                                    </div>

                                </div>
                            </div>
                        </div>
                        <div class="cl"></div>
                        <div class="creat-menbers pt">

                            <input type="hidden" name="template_id" value="{{ $template_id }}">
                            <input type="hidden" name="id" value="{{$id}}">
                            <input  class="creat-current" style="cursor: pointer;" type="button" value="上一步">
                            <input style="cursor: pointer; " id="ml400" type="submit" value="保存">

                        </div>
                    </form>
                    </div>
                </div>

            </div>

    </div>
</div>

    <script src="/backend/js/info.js"></script>
    <script src="/backend/js/laydate.js"></script>
    <script src="/backend/js/function.js"></script>





<script type="text/javascript">
        $(function(){
            foldEve();//显示隐藏
            checkBoxInput();

            $(document).on("click",'[data-toggle="drop-select"]',function (e) {
                $(this).information('dropSelect');
                e.stopPropagation();
            });

            $(document).on("mouseover", "#task_list tr,.task-member-list li", function () {
                $(this).find(".icon-remove2").toggleClass("hide");
                $(this).css("background-color","#e4e4e4");
            });

            $(document).on("mouseout", "#task_list tr,.task-member-list li", function () {
                $(this).find(".icon-remove2").toggleClass("hide");
                $(this).css("background-color","#ffffff");
            });

            /**
             * 绑定click事件
             */
            $(document).on("click",".drop-select-menu li",function (e) {
                $(this).information('dropOption');
                e.stopPropagation();
            });


            $(document).on('click',function(e){
                var ofs=$(e.target).parents().hasClass("bb_con");
                var ofg=$(e.target).hasClass("bb_con");
                var osg=$(e.target).hasClass("shows-pak");
                if(!osg) {
                    if(ofs || ofg){

                    }
                    else{
                        $(".bb_con").hide();
                    }
                }
            });

            $("body").click(function(){
                $(".Pop_up_box").hide();
            })

            $('input[placeholder="查找负责人"]').click(function(){
                event.stopPropagation();
            });
            $('input[placeholder="查找审核人"]').click(function(){
                event.stopPropagation();
            });



            $('.perMesg').mouseenter(function(){
                $(this).find('dd').addClass('showTrsm');
            }).mouseleave(function(){
                $(this).find('dd').removeClass('showTrsm');
            })
        })
</script>


@endsection